package org.team4.web.interceptor;

import org.team4.constants.StringConstant;
import org.team4.util.LoginBean;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class IsLoginedInterceptor extends AbstractInterceptor {

    private static final long serialVersionUID = 8022747182142597416L;

    @Override
    public String intercept(ActionInvocation invocation) throws Exception {
        if (LoginBean.getLoginBean() == null) {
            return StringConstant.NO_LOGIN;
        } else {
            return invocation.invoke();
        }
    }

}
